package cn.mst.vrs.common.entity;

import lombok.Builder;
import lombok.Data;

import java.util.List;

@Data
@Builder
public class PageResult<T> {
    private Long current;
    private Long size;
    private Long total;
    private List<T> records;

    public static <T> PageResult<T> of(Long current, Long total, List<T> records) {
        return PageResult.<T>builder()
                .current(current)
                .size((long) records.size())
                .total(total)
                .records(records)
                .build();
    }
}
